//
//  AXFHomeSever.m
//  AIXF
//
//  Created by zhanghui on 2017/7/9.
//  Copyright © 2017年 Macx. All rights reserved.
//

#import "AXFHomeSever.h"

@implementation AXFHomeSever

#pragma mark - 获取首页焦点的网络接口方法实现


- (void)requestHomeFocusWith:(void (^)(id))sussBLock andFailBlock:(void (^)(NSError *))faliBlock{
    
    self.url = @"focus.json.php";
    self.call = @"1";
    
    [super requestWithSussBlock:^(id response) {
        
        if (sussBLock) sussBLock(response);
        
        
    } andFailBlock:^(NSError *error) {
        
        if (faliBlock) faliBlock(error);
            
    }];
    
}

#pragma mark - 获取首页新鲜热卖的网络接口方法实现
- (void)requestHomeFirstSellWith:(void (^)(id))sussBLock andFailBlock:(void (^)(NSError *))faliBlock{
    
    self.url = @"firstSell.json.php";
    self.call = @"2";
    
    [super requestWithSussBlock:^(id response) {
        
        if (sussBLock) sussBLock(response);
        
    } andFailBlock:^(NSError *error) {
        
        if (faliBlock) faliBlock(error);
        
    }];
    
}

#pragma mark - 程序启动的广告接口
- (void)requestWithLaunchAdWith:(void (^)(id))sussBLock andFailBlock:(void (^)(NSError *))faliBlock{
    
    
    self.url = @"ad.json.php";
    self.call = @"7";
    
    [super requestWithSussBlock:^(id response) {
        
        if (sussBLock) sussBLock(response);
        
    } andFailBlock:^(NSError *error) {
        
        if (faliBlock) faliBlock(error);
        
    }];
}

#pragma mark - 搜索关键词接口
- (void)requestHomeSearchWith:(void (^)(id))sussBLock andFailBlock:(void (^)(NSError *))faliBlock{
    
    
    self.url = @"search.json.php";
    self.call = @"6";
    
    [super requestWithSussBlock:^(id response) {
        
        if (sussBLock) sussBLock(response);
        
    } andFailBlock:^(NSError *error) {
        
        if (faliBlock) faliBlock(error);
        
    }];
    
}

#pragma mark - 搜索结果关键词返回接口
- (void)requestHomeSearchReult:(void (^)(id))sussBLock andFailBlock:(void (^)(NSError *))faliBlock{
    
    self.url = @"promotion.json.php";
    self.call = @"8";
    
    [super requestWithSussBlock:^(id response) {
        
        if (sussBLock) sussBLock(response);
        
    } andFailBlock:^(NSError *error) {
        
        if (faliBlock) faliBlock(error);
        
    }];
    
    
}

@end
